package websocketgulu.demo.service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import websocketgulu.demo.dao.PatientMapper;

import java.util.HashMap;

/**
 * @Classname:PatientService
 * @author :liuao
 * @date：2021/5/19
 */
@Service
public class PatientService {
    @Autowired
    private PatientMapper patientMapper;
    @Transactional
    public void addPatient(HashMap map){
        patientMapper.addPT_info(map);
    }
    public boolean PT_is_exist(HashMap map){
        return patientMapper.PT_is_exist(map)!=null;
    }


    // 登录
    public boolean login(HashMap map){
        String password = (String) map.get("password");
        return password.equals( patientMapper.PT_login( map ) );
    }
}
